let arr = new Array(10).fill(6);
console.log(arr); // [ 6, 6, 6, 6, 6, 6, 6, 6, 6, 6 ]

let arr1 = [1, 2, 3, 4, 5];
arr1.fill(0, 1, 3);
console.log(arr1); // [ 1, 0, 0, 4, 5 ]
